﻿using System.Numerics;

namespace GeometryLib
{
    public static class VectorExtensions
    {
        public static Vector3 ToUnitVector(this Vector3 v)
        {

            var allL = v.X * v.X + v.Y * v.Y + v.Z * v.Z;

            var delta =(float) Math.Sqrt(allL);
            return new Vector3(v.X / delta, v.Y / delta, v.Z / delta);
        }

        public static Vector3 ToScalar(this Vector3 v,float scalar)
        {
            return new Vector3(v.X * scalar, v.Y * scalar, v.Z * scalar);
        }

        public static Vector3 ToScalar(this Vector3 v, double scalar)
        {
            return new Vector3(v.X * (float)scalar, v.Y * (float)scalar, v.Z * (float)scalar);
        }


    }
}
